var app = getApp();

Page({
    data: {},
    onLoad: function(t) {
        var a = this;
        app.setNavigationBarColor(this), wx.hideShareMenu();
        var n = wx.getStorageSync("db_tab"), e = app.contains(n, "../logs/logs");
        console.log(e), 0 != e && (n[e].color = "selsects", n[e].img = n[e].icon1, console.log(n)), 
        a.setData({
            yes: e,
            db_tab: n
        });
        var o = wx.getStorageSync("userInfo").id;
        a.setData({
            url: wx.getStorageSync("url")
        }), app.util.request({
            url: "entry/wxapp/GetFxSet",
            success: function(t) {
                console.log(t), a.setData({
                    GetFxSet: t.data
                });
            }
        }), app.util.request({
            url: "entry/wxapp/getSystem",
            cachetime: "0",
            success: function(t) {
                console.log("这是系统设置"), console.log(t), wx.setNavigationBarTitle({
                    title: t.data.pt_name
                }), a.setData({
                    system: t.data
                });
            }
        }), app.util.request({
            url: "entry/wxapp/TicketCount",
            cachetime: "0",
            data: {
                user_id: o
            },
            success: function(t) {
                console.log(t), a.setData({
                    ticket: t.data[0]
                });
            }
        });
    },
    myyanpiao: function() {
        wx.scanCode({
            success: function(t) {
                console.log(t);
                var a = t.path.slice(42);
                console.log(a), wx.navigateTo({
                    url: "inspect_ticket?arr=" + a
                });
            }
        });
    },
    mypiao: function() {
        wx.navigateTo({
            url: "../piaoquan/piaoquan"
        });
    },
    participate: function(t) {
        wx.navigateTo({
            url: "../piaoquan/piaoquan?activeIndex=1"
        });
    },
    audit: function(t) {
        wx.navigateTo({
            url: "../piaoquan/piaoquan?activeIndex=2"
        });
    },
    ticket_success: function(t) {
        wx.navigateTo({
            url: "../piaoquan/piaoquan?activeIndex=3"
        });
    },
    refund_ticket: function(t) {
        wx.navigateTo({
            url: "../piaoquan/piaoquan?activeIndex=4"
        });
    },
    liuyan: function(t) {
        wx.navigateTo({
            url: "../myactive/myliuyan"
        });
    },
    add_markting: function(t) {
        var a = this.data.user_id;
        app.util.request({
            url: "entry/wxapp/GetSponsor",
            cachetime: "0",
            data: {
                user_id: a
            },
            success: function(t) {
                console.log("这是获取主办方资料"), console.log(t), 0 == t.data ? wx.showModal({
                    title: "创建主办方",
                    content: "您还没有进行填写主办方信息",
                    success: function(t) {
                        t.confirm && (console.log("用户点击确定"), wx.navigateTo({
                            url: "../mycenter/edit"
                        }));
                    }
                }) : wx.navigateTo({
                    url: "add_markting"
                });
            }
        });
    },
    myguanzhu: function() {
        wx.navigateTo({
            url: "../myactive/myguanzhu"
        });
    },
    myactive: function() {
        wx.navigateTo({
            url: "../myactive/myactive"
        });
    },
    myshouru: function() {
        wx.navigateTo({
            url: "../mycenter/myshouru"
        });
    },
    myliuyan: function() {
        var t = this.data.user_id;
        app.util.request({
            url: "entry/wxapp/GetSponsor",
            cachetime: "0",
            data: {
                user_id: t
            },
            success: function(t) {
                console.log("这是获取主办方资料"), console.log(t), 0 == t.data ? wx.showModal({
                    title: "创建主办方",
                    content: "您还没有进行填写主办方信息",
                    success: function(t) {
                        t.confirm && (console.log("用户点击确定"), wx.navigateTo({
                            url: "../mycenter/edit?status=1"
                        }));
                    }
                }) : wx.navigateTo({
                    url: "../authentication/authentication"
                });
            }
        });
    },
    mycenter: function() {
        wx.navigateTo({
            url: "../mycenter/edit"
        });
    },
    fenxiao: function(t) {
        var a = wx.getStorageSync("userInfo").id;
        app.util.request({
            url: "entry/wxapp/MyDistribution",
            data: {
                user_id: a
            },
            success: function(t) {
                console.log(t), 0 == t.data ? wx.navigateTo({
                    url: "../distribution/examine"
                }) : 1 == t.data.state ? wx.showModal({
                    title: "温馨提示",
                    content: "系统正在审核中，请稍后再试"
                }) : 2 == t.data.state ? wx.navigateTo({
                    url: "../distribution/distribution"
                }) : 3 == t.data.state && wx.showModal({
                    title: "温馨提示",
                    content: "您的申请已被拒绝"
                });
            }
        });
    },
    wode: function() {
        var t = this.data.db_tab;
        wx.reLaunch({
            url: t[3].src
        });
    },
    fabu: function() {
        wx.reLaunch({
            url: "../fabu/fabu"
        });
    },
    index: function() {
        var t = this.data.db_tab;
        wx.reLaunch({
            url: t[0].src
        });
    },
    classifination: function(t) {
        var a = this.data.db_tab;
        wx.reLaunch({
            url: a[1].src
        });
    },
    mine_activity: function(t) {
        var a = this.data.db_tab;
        wx.reLaunch({
            url: a[2].src
        });
    },
    group: function(t) {
        wx.navigateTo({
            url: "group_order?state=1"
        });
    },
    check: function() {
        wx.navigateTo({
            url: "../mycenter/check"
        });
    },
    onReady: function() {},
    onShow: function() {
        var a = this;
        app.getUserInfo(function(t) {
            a.setData({
                userInfo: t,
                user_id: t.id
            });
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
});